package main

import (
	"fmt"
)

func main(){
	var username string
	var password string
	fmt.Println("请输入你的用户名：")
	fmt.Scan(&username)
	fmt.Println("请输入你的密码：")
	fmt.Scan(&password)

	check(username,password)
}

func check(username,password string) string{
	var userList = map[string]map[string]string{
		"root":{"password":"123456","tel":"17573908045"},
		"admin":{"password":"250250","tel":"13874263651"},
		"boss":{"password":"430523","tel":"10086"}}

	for name,info := range userList{
		if username == name{
			if info["password"] == password{
				fmt.Printf("验证成功！%s的电话号码是：%s",name,info["tel"])
			}else {
				fmt.Println("密码错误！请重新输入！")
				fmt.Println("请输入你的用户名：")
				fmt.Scan(&username)
				fmt.Println("请输入你的密码：")
				fmt.Scan(&password)

				check(username,password)

			}
		}

	}
	return "123"
}


